/*
 * @Description: 腾讯云-短信发送
 * @Version: 2.0
 * @Author: Symbol_Yang
 * @Date: 2022-06-07 09:51:24
 * @LastEditors: Symbol_Yang
 * @LastEditTime: 2022-10-11 15:29:18
 */
const tencentcloud = require("tencentcloud-sdk-nodejs");
const SmsClient = tencentcloud.sms.v20210111.Client;
const config   = require('config')
// 云函数入口函数
const sendMsg = async (params) => {
  const clientConfig = {
    credential: config.Customer.shortmsg_opt,
    region: "ap-nanjing",
    profile: {
      httpProfile: {
        endpoint: "sms.tencentcloudapi.com",
      },
    },
  };

  const client = new SmsClient(clientConfig);
//  let phoneNums = []
//  event.phone.forEach(item =>{
//      phoneNums.push("+86"+item)
//  })
  // const params = {
  //     "PhoneNumberSet":['+8613818571403'],
  //     "SmsSdkAppId": "1400583943",
  //     "SignName": "华屹咨询",
  //     "TemplateId": "1158555",
  //     "TemplateParamSet": ['03','21']
  // };

  return client.SendSms(params)
}
module.exports = sendMsg